diff --git a/davis_one/davis.cpp b/davis_one/davis.cpp index ce11de6..b001c1e 100644 --- a/davis_one/davis.cpp +++ b/davis_one/davis.cpp @@ -368,8 +368,11 @@ const char kWarningIcon[] = R"davis_delimeter( +%7 -
@@ -379,7 +382,7 @@ id="gd"> var data = [ %2 ]; - +%9 var config = { editable: true, showLink: true, @@ -398,7 +401,7 @@ const char kHtmlMultiChartBlock[] = R"davis_delimeter( var trace%1 = { x: [%2], y: [%3], - type: 'scatter', + mode: 'lines', name: '%4' }; )davis_delimeter"; @@ -409,8 +412,10 @@ var trace%1 = { const char kHtmlMultiChartModel[] = R"davis_delimeter( +%11 +%12
%2 var data = [%3]; - +%13 var layout = { title: { text:'%4' @@ -504,7 +509,7 @@ Plotly.newPlot('gd', data,layout,config); const char kHtmlSimpleDataBlock[]= R"davis_delimeter({ x: [%1], y: [%2], - type: 'scatter' + mode: 'lines' })davis_delimeter"; @@ -547,23 +552,25 @@ const char kHtmlComboboxSelectBlock[] =R"davis_delimeter( const char kHtmlComboboxUpdateFooBlock[] = R"davis_delimeter( function updateBackground(select) { - var selectedImage = select.options[select.selectedIndex].getAttribute('data-image'); select.style.backgroundImage = 'url("data:image/svg+xml,' + encodeURIComponent(selectedImage) + '")'; var selectedOption = select.options[select.selectedIndex].text; + for(let i=0;i configuration.chart.aspectRatioHeight){ @@ -1503,7 +1513,9 @@ void showDateTimeMultichart(const std::string& date_time_values, all_data.append(","); } } - + args[ARG_DATE_TIME_POINT_LINE_SWITCHER_STYLE] = kHtmlComboboxStyleBlock; + args[ARG_DATE_TIME_POINT_LINE_SWITCHER_SELECT] = kHtmlComboboxSelectBlock; + args[ARG_DATE_TIME_POINT_LINE_SWITCHER_UPDATE_FOO] = kHtmlComboboxUpdateFooBlock; args[ARG_DATE_TIME_VALUES_BLOCK] = all_data; args[ARG_DATE_TIME_ASPECT_RATIO_WIDTH] = "1"; args[ARG_DATE_TIME_ASPECT_RATIO_HEIGHT] = "1"; diff --git a/davis_one/davis.h b/davis_one/davis.h index b070b46..c532a0d 100644 --- a/davis_one/davis.h +++ b/davis_one/davis.h @@ -180,7 +180,9 @@ enum ARGS_MULTI_CHARTS_PAGE { ARG_MC_DATE_TIME_ASPECT_RATIO_HEIGHT, //%8 ARG_MC_DATE_ASPECT_WIDTH_OR_HEIGHT, //%9 "width" if ARG_ASPECT_RATIO_WIDTH > ARG_ASPECT_RATIO_HEIGHT and "height" if not ARG_MC_DATE_ASPECT_WIDTH_OR_HEIGHT_FOR_AUTOSCALE, //%10 if value of it is equal to ARG_ASPECT_WIDTH_OR_HEIGHT it's mean no autoscale. - + ARG_MC_POINT_LINE_SWITCHER_STYLE, //%11 + ARG_MC_TIME_POINT_LINE_SWITCHER_SELECT, //%12 + ARG_MC_TIME_POINT_LINE_SWITCHER_UPDATE_FOO, //%13 // ADD NEW ENUM BEFORE THIS COMMENT ARGS_MULTI_CHARTS_PAGE_SIZE }; diff --git a/gui/davis_gui.cpp b/gui/davis_gui.cpp index 977555f..e92a60d 100644 --- a/gui/davis_gui.cpp +++ b/gui/davis_gui.cpp @@ -679,6 +679,7 @@ bool DavisGUI::checkDateTimeVariant(const QStringList& lines) { for (int i = 0; i < lines.size(); ++i) { QString test = lines[i]; + test.replace("'", ""); for (int j = 0; j < jarr.size(); ++j) { int template_time_stamp_size = jarr[j].toString().size(); QString template_time_stamp = jarr[j].toString(); @@ -752,6 +753,7 @@ bool DavisGUI::checkDateTimeVariant(const QStringList& lines) { } + void DavisGUI::selectAndShowFiles() { QStringList fileNames = QFileDialog::getOpenFileNames(this, @@ -921,7 +923,6 @@ void DavisGUI::visualizeFiles(const QStringList& file_list) { QString outX, outY; QString trace_block = dvs::kHtmlMultiChartBlock; if (isFileContainsSingleChart(file_list[i], outX, outY)) { - //qDebug()< +%7 -
@@ -347,7 +350,7 @@ id="gd"> var data = [ %2 ]; - +%9 var config = { editable: true, showLink: true, @@ -366,7 +369,7 @@ const char kHtmlMultiChartBlock[] = R"davis_delimeter( var trace%1 = { x: [%2], y: [%3], - type: 'scatter', + mode: 'lines', name: '%4' }; )davis_delimeter"; @@ -377,8 +380,10 @@ var trace%1 = { const char kHtmlMultiChartModel[] = R"davis_delimeter( +%11 +%12
%2 var data = [%3]; - +%13 var layout = { title: { text:'%4' @@ -472,7 +477,7 @@ Plotly.newPlot('gd', data,layout,config); const char kHtmlSimpleDataBlock[]= R"davis_delimeter({ x: [%1], y: [%2], - type: 'scatter' + mode: 'lines' })davis_delimeter"; @@ -515,23 +520,25 @@ const char kHtmlComboboxSelectBlock[] =R"davis_delimeter( const char kHtmlComboboxUpdateFooBlock[] = R"davis_delimeter( function updateBackground(select) { - var selectedImage = select.options[select.selectedIndex].getAttribute('data-image'); select.style.backgroundImage = 'url("data:image/svg+xml,' + encodeURIComponent(selectedImage) + '")'; var selectedOption = select.options[select.selectedIndex].text; + for(let i=0;i ARG_ASPECT_RATIO_HEIGHT and "height" if not ARG_MC_DATE_ASPECT_WIDTH_OR_HEIGHT_FOR_AUTOSCALE, //%10 if value of it is equal to ARG_ASPECT_WIDTH_OR_HEIGHT it's mean no autoscale. - + ARG_MC_POINT_LINE_SWITCHER_STYLE, //%11 + ARG_MC_TIME_POINT_LINE_SWITCHER_SELECT, //%12 + ARG_MC_TIME_POINT_LINE_SWITCHER_UPDATE_FOO, //%13 // ADD NEW ENUM BEFORE THIS COMMENT ARGS_MULTI_CHARTS_PAGE_SIZE }; diff --git a/plotly_maker/plotly_maker.cpp b/plotly_maker/plotly_maker.cpp index 438f57b..f7fb781 100644 --- a/plotly_maker/plotly_maker.cpp +++ b/plotly_maker/plotly_maker.cpp @@ -425,6 +425,9 @@ void showDateTimeChart(const string& date_time_values, args[ARG_DATE_TIME_VALUES_BLOCK] = data_values_block; args[ARG_DATE_TIME_ASPECT_RATIO_WIDTH] = "1"; args[ARG_DATE_TIME_ASPECT_RATIO_HEIGHT] = "1"; + args[ARG_DATE_TIME_POINT_LINE_SWITCHER_STYLE] = kHtmlComboboxStyleBlock; + args[ARG_DATE_TIME_POINT_LINE_SWITCHER_SELECT] = kHtmlComboboxSelectBlock; + args[ARG_DATE_TIME_POINT_LINE_SWITCHER_UPDATE_FOO] = kHtmlComboboxUpdateFooBlock; /* string paramWH; if(configuration.chart.aspectRatioWidth > configuration.chart.aspectRatioHeight){ @@ -587,7 +590,9 @@ void showDateTimeMultichart(const std::string& date_time_values, all_data.append(","); } } - + args[ARG_DATE_TIME_POINT_LINE_SWITCHER_STYLE] = kHtmlComboboxStyleBlock; + args[ARG_DATE_TIME_POINT_LINE_SWITCHER_SELECT] = kHtmlComboboxSelectBlock; + args[ARG_DATE_TIME_POINT_LINE_SWITCHER_UPDATE_FOO] = kHtmlComboboxUpdateFooBlock; args[ARG_DATE_TIME_VALUES_BLOCK] = all_data; args[ARG_DATE_TIME_ASPECT_RATIO_WIDTH] = "1"; args[ARG_DATE_TIME_ASPECT_RATIO_HEIGHT] = "1";